The present invention is related to the field of computer graphics, and in particular to volume graphics.
Volume graphics is the subfield of computer graphics that deals with the visualization of objects or phenomena represented as sampled data in three or more dimensions. These samples are called volume elements, or xe2x80x9cvoxels,xe2x80x9d and contain digital information representing physical characteristics of the objects or phenomena being studied. For example, voxel values for a particular object or system may represent density, type of material, temperature, velocity, or some other property at discrete points in space throughout the interior and in the vicinity of that object or system.
Volume rendering is the part of volume graphics concerned with the projection of volume data as two-dimensional images for purposes of printing, display on computer terminals, and other forms of visualization. By assigning colors and transparency to particular voxel data values, different views of the exterior and interior of an object or system can be displayed. For example, a surgeon needing to examine the ligaments, tendons, and bones of a human knee in preparation for surgery can utilize a tomographic scan of the knee and cause voxel data values corresponding to blood, skin, and muscle to appear to be completely transparent. The resulting image then reveals the condition of the ligaments, tendons, bones, etc. which are hidden from view prior to surgery, thereby allowing for better surgical planning, shorter surgical operations, less surgical exploration and faster recoveries. In another example, a mechanic using a tomographic scan of a turbine blade or welded joint in a jet engine can cause voxel data values representing solid metal to appear to be transparent while causing those representing air to be opaque. This allows the viewing of internal flaws in the metal that would otherwise be hidden from the human eye.
Real-time volume rendering is the projection and display of volume data as a series of images in rapid succession, typically at 30 frames per second or faster. This makes it possible to create the appearance of moving pictures of the object, phenomenon, or system of interest. It also enables a human operator to interactively control the parameters of the projection and to manipulate the image, while providing to the user immediate visual feedback. It will be appreciated that projecting tens of millions or hundreds of millions of voxel values to an image requires enormous amounts of computing power. Doing so in real time requires substantially more computational power.
Further background on volume rendering is included in a Doctoral Dissertation entitled xe2x80x9cArchitectures for Real-Time Volume Renderingxe2x80x9d submitted by Hanspeter Pfister to the Department of Computer Science at the State University of New York at Stony Brook in December 1996, and in U.S. Pat. No. 5,594,842, xe2x80x9cApparatus and Method for Real-time Volume Visualization.xe2x80x9d Additional background on volume rendering is presented in a book entitled xe2x80x9cIntroduction to Volume Renderingxe2x80x9d by Barthold Lichtenbelt, Randy Crane, and Shaz Naqvi, published in 1998 by Prentice Hall PTR of Upper Saddle River, N.J.
The reconstruction of images from sampled data is the domain of a branch of mathematics known as xe2x80x9csampling theoryxe2x80x9d. From the well-known Nyquist sampling theorem, the frequency at which data must be sampled must equal or exceed twice the spatial frequency of the data in order to obtain faithful reconstruction of the information in the data. This constraint is true in multiple dimensions as well as in one dimension.
Volume data sets are typically organized as samples along regular grids in three dimensions, which defines the spatial frequency inherent in the data. In order to project three-dimensional volume data onto a two-dimensional image plane by ray-casting, the data must be re-sampled at a sampling frequency equal to or greater than the Nyquist frequency. If the sampling frequency is not sufficiently high, undesirable visual artifacts caused by aliasing appear in the rendered image, especially moving images such as images being manipulated by a human viewer in real-time. Thus one of the challenges in real-time volume rendering is the efficient re-sampling of volume data in support of high-quality rendering from an arbitrary and changing view direction.
Another aspect of volume rendering is the application of artificial xe2x80x9cilluminationxe2x80x9d or xe2x80x9clightingxe2x80x9d to the rendered image, which is the creation of highlights and shadows that are essential to a realistic two-dimensional representation of a three-dimensional object. Lighting techniques are well-known in the computer graphics art and are described, for example, in the textbook xe2x80x9cComputer Graphics: Principles and Practice,xe2x80x9d 2nd edition, by J. Foley, A. vanDam, S. Feiner, and J. Hughes, published by Addison-Wesley of Reading, Mass., in 1990.
One illumination technique that generates very high quality images is known as xe2x80x9cPhong illuminationxe2x80x9d or xe2x80x9cPhong shadingxe2x80x9d. The Phong illumination algorithm requires knowledge of the orientation of surfaces appearing in the rendered image. Surface orientation is indicated by a vector referred to as a xe2x80x9cnormalxe2x80x9d. In volume rendering, one way to obtain the normal is to estimate gradients for the samples of the volume data. Various techniques can be used to calculate gradients. According to one commonly-used technique, the gradients are estimated by calculating xe2x80x9ccentral differencesxe2x80x9d. That is, the gradient in a given direction at a sample point is equal to the difference between the values of the two sample points surrounding the sample in the indicated direction.
The performance of illumination algorithms in general is very sensitive to the accuracy of the gradient calculation. To obtain the best-quality rendered image, it is important that gradients be calculated very accurately.
In a ray-casting system in which sample planes are normal to the rays, it is fairly straightforward to calculate gradients from samples of the volume data using central differences. There are, however, systems in which sample planes are parallel to the planes of voxels, so that the angle between sample planes and rays is dependent on view angle. One example of such a system is shown in the aforementioned Doctoral Dissertation. In these systems, the calculation of gradients is substantially more difficult, because the weight to be given neighboring samples is dependent on the viewing angle.
One prior technique for calculating gradient values has been to calculate an intermediate value using unity weights, and then to apply a correction factor that is a function of viewing angle. Unfortunately, this technique is both complicated and inaccurate. It would be desirable to improve the performance of illumination algorithms such as Phong illumination by enabling the calculation of accurate gradients in a manner that lends itself to efficient hardware implementation in a volume rendering processor.
In accordance with the present invention, a ray-casting volume rendering processor is disclosed which in which volume data is efficiently re-sampled as an image is rendering from an arbitrary and changing view direction. Accurate gradients are calculated for use in a Phong illumination algorithm, and high rendering throughput is maintained while the appearance of sampling-induced artifacts in the rendered image is minimized.
The disclosed volume rendering processor includes voxel memory interface logic operative to continually retrieve the voxels from a voxel memory in which a volume data set is stored. The voxel memory is scanned in order with respect to a Cartesian coordinate system having mutually perpendicular X, Y and Z coordinate axes, the Z axis being the axis more nearly parallel to a predefined viewing direction than either the X or Y axes. Interpolation logic coupled to the voxel memory interface logic continually receives the retrieved voxels and calculates samples such that (i) each sample lies along a corresponding imaginary ray extending through the object parallel to the viewing direction, (ii) each sample is the result of interpolation among a surrounding set of voxels in the Cartesian coordinate system, and (iii) the spatial frequency of the samples in one or more or the X, Y and Z directions is greater than the spatial frequency of the voxels in the same direction. This xe2x80x9csupersamplingxe2x80x9d greatly reduces the presence of visual artifacts in the rendered image.
In another disclosed technique, X and Y components of gradients are calculated from samples emitted by the interpolation logic, and Z gradients are calculated by (i) calculating Z gradients at the voxel positions from voxel values retrieved from memory, and (ii) interpolating the voxel Z gradients to arrive at the Z gradients at the sample positions. The calculation of Z-gradients from the voxels rather than from samples greatly simplifies the calculation of the Z gradients while attaining greater accuracy over prior approaches.
In yet another disclosed technique, the interpolation logic generates (i) a first set of intermediate interpolation values by interpolating between adjacent voxels in a first dimension, and (ii) a second set of intermediate interpolation values resulting by interpolating between the first intermediate interpolation values in a second dimension, and the samples representing the re-sampling of the retrieved voxels are calculated by interpolating between the second intermediate interpolation values in the third dimension. The intermediate interpolation values are used to calculate multiple adjacent samples, so that high throughput in the interpolation stages is maintained.
Other aspects, features, and advantages of the present invention are disclosed in the detailed description which follows.